3.1.15 \(\int (a+a \sin (c+d x))^2 \tan ^3(c+d x) \, dx\) [15]

Optimal. Leaf size=72 \[ \frac {3 a^2 \log (1-\sin (c+d x))}{d}+\frac {2 a^2 \sin (c+d x)}{d}+\frac {a^2 \sin ^2(c+d x)}{2 d}+\frac {a^3}{d (a-a \sin (c+d x))} \]

[Out]

3*a^2*ln(1-sin(d*x+c))/d+2*a^2*sin(d*x+c)/d+1/2*a^2*sin(d*x+c)^2/d+a^3/d/(a-a*sin(d*x+c))

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 72, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {2786, 45} \begin {gather*} \frac {a^3}{d (a-a \sin (c+d x))}+\frac {a^2 \sin ^2(c+d x)}{2 d}+\frac {2 a^2 \sin (c+d x)}{d}+\frac {3 a^2 \log (1-\sin (c+d x))}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + a*Sin[c + d*x])^2*Tan[c + d*x]^3,x]

[Out]

(3*a^2*Log[1 - Sin[c + d*x]])/d + (2*a^2*Sin[c + d*x])/d + (a^2*Sin[c + d*x]^2)/(2*d) + a^3/(d*(a - a*Sin[c +
d*x]))

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2786

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[x^p*((a + x)^(m - (p + 1)/2)/(a - x)^((p + 1)/2)), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x]
&& EqQ[a^2 - b^2, 0] && IntegerQ[(p + 1)/2]

Rubi steps

\begin {align*} \int (a+a \sin (c+d x))^2 \tan ^3(c+d x) \, dx &=\frac {\text {Subst}\left (\int \frac {x^3}{(a-x)^2} \, dx,x,a \sin (c+d x)\right )}{d}\\ &=\frac {\text {Subst}\left (\int \left (2 a+\frac {a^3}{(a-x)^2}-\frac {3 a^2}{a-x}+x\right ) \, dx,x,a \sin (c+d x)\right )}{d}\\ &=\frac {3 a^2 \log (1-\sin (c+d x))}{d}+\frac {2 a^2 \sin (c+d x)}{d}+\frac {a^2 \sin ^2(c+d x)}{2 d}+\frac {a^3}{d (a-a \sin (c+d x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.07, size = 54, normalized size = 0.75 \begin {gather*} \frac {a^2 \left (6 \log (1-\sin (c+d x))+\frac {2}{1-\sin (c+d x)}+4 \sin (c+d x)+\sin ^2(c+d x)\right )}{2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + a*Sin[c + d*x])^2*Tan[c + d*x]^3,x]

[Out]

(a^2*(6*Log[1 - Sin[c + d*x]] + 2/(1 - Sin[c + d*x]) + 4*Sin[c + d*x] + Sin[c + d*x]^2))/(2*d)

________________________________________________________________________________________

Maple [A]
time = 0.17, size = 136, normalized size = 1.89

method result size
risch \(-3 i a^{2} x -\frac {i a^{2} {\mathrm e}^{i \left (d x +c \right )}}{d}+\frac {i a^{2} {\mathrm e}^{-i \left (d x +c \right )}}{d}-\frac {6 i a^{2} c}{d}-\frac {2 i a^{2} {\mathrm e}^{i \left (d x +c \right )}}{\left ({\mathrm e}^{i \left (d x +c \right )}-i\right )^{2} d}+\frac {6 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}-\frac {a^{2} \cos \left (2 d x +2 c \right )}{4 d}\) \(125\)
derivativedivides \(\frac {a^{2} \left (\frac {\sin ^{6}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\left (\sin ^{4}\left (d x +c \right )\right )}{2}+\sin ^{2}\left (d x +c \right )+2 \ln \left (\cos \left (d x +c \right )\right )\right )+2 a^{2} \left (\frac {\sin ^{5}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\left (\sin ^{3}\left (d x +c \right )\right )}{2}+\frac {3 \sin \left (d x +c \right )}{2}-\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a^{2} \left (\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}+\ln \left (\cos \left (d x +c \right )\right )\right )}{d}\) \(136\)
default \(\frac {a^{2} \left (\frac {\sin ^{6}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\left (\sin ^{4}\left (d x +c \right )\right )}{2}+\sin ^{2}\left (d x +c \right )+2 \ln \left (\cos \left (d x +c \right )\right )\right )+2 a^{2} \left (\frac {\sin ^{5}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\left (\sin ^{3}\left (d x +c \right )\right )}{2}+\frac {3 \sin \left (d x +c \right )}{2}-\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a^{2} \left (\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}+\ln \left (\cos \left (d x +c \right )\right )\right )}{d}\) \(136\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+a*sin(d*x+c))^2*tan(d*x+c)^3,x,method=_RETURNVERBOSE)

[Out]

1/d*(a^2*(1/2*sin(d*x+c)^6/cos(d*x+c)^2+1/2*sin(d*x+c)^4+sin(d*x+c)^2+2*ln(cos(d*x+c)))+2*a^2*(1/2*sin(d*x+c)^
5/cos(d*x+c)^2+1/2*sin(d*x+c)^3+3/2*sin(d*x+c)-3/2*ln(sec(d*x+c)+tan(d*x+c)))+a^2*(1/2*tan(d*x+c)^2+ln(cos(d*x
+c))))

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 58, normalized size = 0.81 \begin {gather*} \frac {a^{2} \sin \left (d x + c\right )^{2} + 6 \, a^{2} \log \left (\sin \left (d x + c\right ) - 1\right ) + 4 \, a^{2} \sin \left (d x + c\right ) - \frac {2 \, a^{2}}{\sin \left (d x + c\right ) - 1}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(d*x+c))^2*tan(d*x+c)^3,x, algorithm="maxima")

[Out]

1/2*(a^2*sin(d*x + c)^2 + 6*a^2*log(sin(d*x + c) - 1) + 4*a^2*sin(d*x + c) - 2*a^2/(sin(d*x + c) - 1))/d

________________________________________________________________________________________

Fricas [A]
time = 0.35, size = 90, normalized size = 1.25 \begin {gather*} -\frac {6 \, a^{2} \cos \left (d x + c\right )^{2} - 3 \, a^{2} - 12 \, {\left (a^{2} \sin \left (d x + c\right ) - a^{2}\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) + {\left (2 \, a^{2} \cos \left (d x + c\right )^{2} + 7 \, a^{2}\right )} \sin \left (d x + c\right )}{4 \, {\left (d \sin \left (d x + c\right ) - d\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(d*x+c))^2*tan(d*x+c)^3,x, algorithm="fricas")

[Out]

-1/4*(6*a^2*cos(d*x + c)^2 - 3*a^2 - 12*(a^2*sin(d*x + c) - a^2)*log(-sin(d*x + c) + 1) + (2*a^2*cos(d*x + c)^
2 + 7*a^2)*sin(d*x + c))/(d*sin(d*x + c) - d)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a^{2} \left (\int 2 \sin {\left (c + d x \right )} \tan ^{3}{\left (c + d x \right )}\, dx + \int \sin ^{2}{\left (c + d x \right )} \tan ^{3}{\left (c + d x \right )}\, dx + \int \tan ^{3}{\left (c + d x \right )}\, dx\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(d*x+c))**2*tan(d*x+c)**3,x)

[Out]

a**2*(Integral(2*sin(c + d*x)*tan(c + d*x)**3, x) + Integral(sin(c + d*x)**2*tan(c + d*x)**3, x) + Integral(ta
n(c + d*x)**3, x))

________________________________________________________________________________________

Giac [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(d*x+c))^2*tan(d*x+c)^3,x, algorithm="giac")

[Out]

Timed out

________________________________________________________________________________________

Mupad [B]
time = 7.11, size = 204, normalized size = 2.83 \begin {gather*} \frac {6\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5-6\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+8\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-6\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+6\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1\right )}+\frac {6\,a^2\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )}{d}-\frac {3\,a^2\,\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)^3*(a + a*sin(c + d*x))^2,x)

[Out]

(8*a^2*tan(c/2 + (d*x)/2)^3 - 6*a^2*tan(c/2 + (d*x)/2)^2 - 6*a^2*tan(c/2 + (d*x)/2)^4 + 6*a^2*tan(c/2 + (d*x)/
2)^5 + 6*a^2*tan(c/2 + (d*x)/2))/(d*(3*tan(c/2 + (d*x)/2)^2 - 2*tan(c/2 + (d*x)/2) - 4*tan(c/2 + (d*x)/2)^3 +
3*tan(c/2 + (d*x)/2)^4 - 2*tan(c/2 + (d*x)/2)^5 + tan(c/2 + (d*x)/2)^6 + 1)) + (6*a^2*log(tan(c/2 + (d*x)/2) -
 1))/d - (3*a^2*log(tan(c/2 + (d*x)/2)^2 + 1))/d

________________________________________________________________________________________